<?php
namespace app\home\model;

use think\Db;
use think\Model;

class Giftrecord extends Model
{
   protected $table = 'rd_home_giftrecord';
    /**
     * 显示列表.
     *
     * @return \think\Response
     */
    public  function lists($data){
        //
        $lists =Giftrecord::alias('record')
            ->join('home_gifts F','record.giftid = F.id ')
            ->join('home_users U','record.uid = U.id')
            ->join('home_users G','record.givenid = G.id')
            ->order('create_time desc')
            ->field('record.id,record.uid,U.nickname uname,record.givenid,G.nickname gname,record.giftid,F.giftname,record.create_time')
            ->paginate($data['listrow']);
       if (!empty($lists)){
           return $lists;
       }else{
           return false;
       }
    }
}